home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1991 / Feb 91 / MacApp.Tech$ 2⁄8⁄91 / 2874-need help with TDocu-Feb91 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.8 KB  |  46 lines  |  [TEXT/GEOL]

  1. Item    2114559                         7-Feb-91        12:13PST
  2.  
  3. From:   MM.XOBJ                         MacroMind, XObject Support,PRT
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. ------------------------------------------------------------------------------
  8.  
  9. Sub:    need help with TDocument!
  10.  
  11. I need help from someone who is intimate with the workings of TDocument.
  12.  
  13. My application uses disk based documents.  They never have a "memory only"
  14. existence.  In this regard it is similar to HyperCard, which always updates an
  15. open disk image of the document.
  16.  
  17. TDocument is strongly oriented in favor of memory-based documents, and thinks
  18. that it is cool to open a new file whenever it is time to save, and delete the
  19. prior copy of the file afterwords.
  20.  
  21. From the time I create a new document, or open an existing file, I need to keep
  22. the Data fork open (the only one I use), and whenever saving the file, I need
  23. to make sure that the file I write to is the same as the one I originally
  24. opened.  Even when I create a new Document, I open a file and install it in the
  25. Document instance from my DoInitialState() method like this:
  26.  
  27.     RequestAFileName(...);      // get a filename, directory from user
  28.     OpenAFile(...);             // open a file of that name
  29.     SavedOn(...);               // install all this info in TDocument
  30.  
  31. I am trying to address this issue by overriding SaveInPlace(), and setting
  32. fSaveInPlace = sipAlways.  However, this method is only called under very
  33. limited circumstances, as a last resort to saving a file that would not
  34. otherwise fit.
  35.  
  36. I just cannot figure out from all the MacApp documentation and examples what I
  37. need to do to keep the file (and its refnum) I orginally open the same
  38. throughout the editing process.
  39.  
  40. Can someone help me figure this out?
  41.  
  42. Haim Zamir
  43. MacroMind, Inc.
  44. AppleLink MM.XOBJ
  45.  
  46.